package com.im.matching.controller;

import com.im.common.utils.R;
import com.im.common.vo.MatchVo;
import com.im.feign.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @auther Zeng
 * @date 2023/7/10 - 21:05
 * @Version 1.0
 */

@Slf4j
@RestController
@RequestMapping("/match")
public class MatchController {

    @Autowired
    private UserService userService;


    @PostMapping("/getMatch")
    public R recommending(@RequestBody MatchVo matchVo){

        log.debug("matchVo:{}",matchVo);


//        Integer sex = Integer.parseInt(map.get("sex").toString()) ;
//
//        Integer sameCity = Integer.parseInt(map.get("sameCity").toString()) ;
//
//        Integer minAge = Integer.parseInt(map.get("minAge").toString()) ;
//
//        Integer maxAge = Integer.parseInt(map.get("maxAge").toString()) ;

        List matchPeople = userService.getMatchPeople(matchVo);

        return R.seccess(matchPeople);
    }
}
